home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / pascal / pibcat.zip / PIBCAT.GLO < prev    next >
Text File  |  1989-04-01  |  9KB  |  164 lines

  1. (*----------------------------------------------------------------------*)
  2. (*                   GLOBAL VARIABLE DEFINITIONS                        *)
  3. (*----------------------------------------------------------------------*)
  4.  
  5. USES                               (* DOS but not IBM PC specific *)
  6.    Dos;
  7.  
  8. TYPE
  9.  
  10.    AnyStr   = STRING[255]  (* Matches any string for parameter passing *);
  11.  
  12.    String2  = STRING[2]    (* Two character string *);
  13.  
  14.    String3  = STRING[3]    (* Three character string *);
  15.  
  16.    String8  = STRING[8]    (* Eight character string *);
  17.  
  18. (*----------------------------------------------------------------------*)
  19. (*                  Error types for library files                       *)
  20. (*----------------------------------------------------------------------*)
  21.  
  22. CONST
  23.    Open_Error    = 1               (* Error when opening file    *);
  24.    Format_Error  = 2               (* Library format bad         *);
  25.    End_Of_File   = 3               (* End of library directory   *);
  26.    Too_Many_Subs = 4               (* Too many nested subdirs    *);
  27.  
  28. (*----------------------------------------------------------------------*)
  29. (*                    Global program variables                          *)
  30. (*----------------------------------------------------------------------*)
  31.  
  32. CONST
  33.    FF_Char               : CHAR = ^L        (* Form feed character      *);
  34.  
  35. TYPE
  36.    Output_Buffer         = ARRAY[1..8192] OF CHAR;
  37.  
  38. TYPE
  39.    Condensed_Type        = ( Condensed_Columnar, Condensed_Comma );
  40.  
  41. VAR
  42.    Cat_Drive             : CHAR             (* Drive to catalog         *);
  43.    Output_File           : TEXT             (* File to receive output   *);
  44.    Output_File_Name      : AnyStr           (* Output file name         *);
  45.    Output_File_Buffer    : Output_Buffer    (* Output file buffer       *);
  46.    Status_File           : TEXT             (* Processing status lines  *);
  47.    Status_File_Name      : AnyStr           (* Status file name         *);
  48.    Do_Printer_Format     : BOOLEAN          (* Format for printer       *);
  49.    Left_Margin           : INTEGER          (* Left margin              *);
  50.    Page_Size             : INTEGER          (* Page size for output     *);
  51.    Expand_Libs           : BOOLEAN          (* TRUE to expand libraries *);
  52.    Expand_Libs_In        : BOOLEAN          (* TRUE to expand libraries *)
  53.                                             (* in main catalog list     *);
  54.    Left_Margin_String    : AnyStr           (* Blanks for left margin   *);
  55.    Library_Indent        : INTEGER          (* Indent for libraries     *);
  56.    User_Break            : BOOLEAN          (* TRUE if ^C stops liting  *);
  57.    Find_Spec             : AnyStr           (* File spec for listing    *);
  58.    Entry_Spec            : AnyStr           (* Entry spec for listing   *);
  59.    Entry_Name            : AnyStr           (* Name portion, entry spec *);
  60.    Entry_Ext             : AnyStr           (* Extension, entry spec    *);
  61.    Use_Entry_Spec        : BOOLEAN          (* TRUE to use entry spec   *);
  62.    Total_Files           : LONGINT          (* Total files found        *);
  63.    Total_Space           : LONGINT          (* Total space used         *);
  64.    Total_Entries         : LONGINT          (* Total entries found      *);
  65.    Total_ESpace          : LONGINT          (* Total space used, entries*);
  66.    Total_Dirs            : LONGINT          (* Total dirs scanned       *);
  67.    Current_Entries       : LONGINT          (* Entries in current lib.  *);
  68.    Page_Number           : INTEGER          (* Current page number      *);
  69.    Lines_Left            : INTEGER          (* Lines left on cur. page  *);
  70.    Help_Only             : BOOLEAN          (* TRUE if doing help only  *);
  71.    Read_Open_Mode        : BYTE             (* Open mode for reads      *);
  72.    Write_Open_Mode       : BYTE             (* Open mode for writes     *);
  73.    Show_Long_File_Names  : BOOLEAN          (* Show long file names     *);
  74.    Use_Share             : BOOLEAN          (* TRUE to use SHARE        *);
  75.    GMT_Difference        : LONGINT          (* # hours local time       *);
  76.                                             (* leads/lags GMT           *)
  77.    Use_Daylight_Savings  : BOOLEAN          (* TRUE to adjust times for *);
  78.                                             (* daylight savings in .DWC *)
  79.    Do_Condensed_Listing  : BOOLEAN          (* TRUE to produce condensed*);
  80.                                             (* format listing.          *)
  81.    Condensed_Listing_Type: Condensed_Type   (* Type of condensed listing*);
  82.    Volume_Label          : AnyStr           (* Disk volume label        *);
  83.    Condensed_Output_Line : AnyStr           (* Condensed output line    *);
  84.    Do_Blank_Line         : BOOLEAN          (* TRUE to print blank line *);
  85.    Current_Subdirectory  : AnyStr           (* Current subdirectory     *);
  86.    Open_For_Append       : BOOLEAN          (* Open output for append   *);
  87.  
  88. (*----------------------------------------------------------------------*)
  89. (*                  Titles and subtitles for paginated listings         *)
  90. (*----------------------------------------------------------------------*)
  91.  
  92. VAR
  93.    Volume_Title : AnyStr           (* Main title for entire listing *);
  94.    Subdir_Title : AnyStr           (* Current subdirectory title    *);
  95.    File_Title   : AnyStr           (* Current library file if any   *);
  96.  
  97. (*----------------------------------------------------------------------*)
  98. (*                  Saved file names from nested directories            *)
  99. (*----------------------------------------------------------------------*)
  100.  
  101. CONST
  102.    MaxFiles              = 2047             (* Max files in one segment   *);
  103.    MaxSeg                = 360              (* Maximum # segments         *);
  104.    SegShift              = 11               (* 2 ** 11 = 2048             *);
  105.  
  106. TYPE
  107.  
  108.    Short_Dir_Record = RECORD
  109.                          File_Attr : BYTE        (* File attributes *);
  110.                          File_Time : LONGINT     (* Creation time   *);
  111.                          File_Size : LONGINT     (* Size in bytes   *);
  112.                          File_Name : STRING[12]  (* File name       *);
  113.                       END;
  114.  
  115.    File_Stack_Type  = ARRAY[0..MaxFiles] OF Short_Dir_Record;
  116.    File_Stack_Ptr   = ^File_Stack_Type;
  117.  
  118. VAR
  119.                                    (* List of files in current and all  *)
  120.                                    (* previous directories along path   *)
  121.                                    (* back to root directory.           *)
  122.                                    (*                                   *)
  123.                                    (* Since Turbo Pascal doesn't allow  *)
  124.                                    (* arrays to exceed 64K bytes in     *)
  125.                                    (* size, we will use a vector of     *)
  126.                                    (* pointers to simulate a long       *)
  127.                                    (* vector.  The size of each segment *)
  128.                                    (* is chosen to be a power of 2 so   *)
  129.                                    (* that subscripts can be expressed  *)
  130.                                    (* using simple masking operations.  *)
  131.  
  132.    File_Stack  : ARRAY[ 0 .. MaxSeg ] OF File_Stack_Ptr;
  133.  
  134.    Stack_Alloc : INTEGER           (* # of stack entries allocated     *);
  135.  
  136.    File_Count  : WORD              (* # of files currently saved       *);
  137.  
  138. (*----------------------------------------------------------------------*)
  139. (*   Names of the months and days in each month for date conversions    *)
  140. (*----------------------------------------------------------------------*)
  141.  
  142. (* STRUCTURED *) CONST
  143.    Month_Names : ARRAY[1..12] OF STRING[3] =
  144.                  ('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
  145.                   'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' );
  146.  
  147. (* STRUCTURED *) CONST
  148.    Days_Per_Month : ARRAY[1..12] OF BYTE
  149.                     = ( 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 );
  150.  
  151. (*----------------------------------------------------------------------*)
  152. (*   Starting/ending dates for daylight savings time from 1980 to now   *)
  153. (*----------------------------------------------------------------------*)
  154.  
  155. TYPE
  156.    Daylight_Savings_Record = RECORD
  157.                                 Starting_Time : LONGINT;
  158.                                 Ending_Time   : LONGINT;
  159.                              END;
  160.  
  161. VAR
  162.    Daylight_Savings_Time : ARRAY[1980..2000] OF Daylight_Savings_Record;
  163.  
  164.